using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._General
{
    /// <summary>
    /// <para>Create Database View</para>
    /// <para>Creates a view in a database based on an SQL expression.</para>
    /// <para>基于 SQL 表达式在数据库中创建视图。</para>
    /// </summary>    
    [DisplayName("Create Database View")]
    public class CreateDatabaseView : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateDatabaseView()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_database">
        /// <para>Input Workspace</para>
        /// <para>The database that contains the tables or feature classes used to construct the view. This database is also where the view will be created.</para>
        /// <para>包含用于构建视图的表或要素类的数据库。此数据库也是创建视图的位置。</para>
        /// </param>
        /// <param name="_view_name">
        /// <para>Output View Name</para>
        /// <para>The name of the view that will be created in the database.</para>
        /// <para>将在数据库中创建的视图的名称。</para>
        /// </param>
        /// <param name="_view_definition">
        /// <para>View Definition</para>
        /// <para>An SQL statement used to construct the view.</para>
        /// <para>用于构造视图的 SQL 语句。</para>
        /// </param>
        public CreateDatabaseView(object _input_database, object _view_name, object _view_definition)
        {
            this._input_database = _input_database;
            this._view_name = _view_name;
            this._view_definition = _view_definition;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Database View";

        public override string CallName => "management.CreateDatabaseView";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_input_database, _view_name, _view_definition, _out_layer];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>The database that contains the tables or feature classes used to construct the view. This database is also where the view will be created.</para>
        /// <para>包含用于构建视图的表或要素类的数据库。此数据库也是创建视图的位置。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_database { get; set; }


        /// <summary>
        /// <para>Output View Name</para>
        /// <para>The name of the view that will be created in the database.</para>
        /// <para>将在数据库中创建的视图的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output View Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _view_name { get; set; }


        /// <summary>
        /// <para>View Definition</para>
        /// <para>An SQL statement used to construct the view.</para>
        /// <para>用于构造视图的 SQL 语句。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("View Definition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _view_definition { get; set; }


        /// <summary>
        /// <para>Output Layer</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_layer { get; set; }


        public CreateDatabaseView SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}